#include <stdio.h>
int f(int n) {
  int i = 1, result = 1;
  for (i = 1; i <= n; i += 2)
    result *= i;
  return result;
}

int main() {
  int T, n;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    int s = 0, i;
    for (i = 1; i <= n; i++)
      s += f(i);
    printf("%d\n", s);
  }
  return 0;
}
